import * as types from './mutation-type.js'

export const addToHistory = ({commit}, article) => {
	console.log('invoke action addToHistory', article)
	if(article.enabled) {
		commit(types.ADD_TO_HISTORY, {
			id: article.id, title: article.title
		});
	}
}

// export const clearHistory = ({commit}, historyList) => {
// 	console.log('invoke action clearHistory');
// 	// historyList.forEach((item, i) => {
// 	// 	console.log('item', item);
// 	// 	// commit(types.ENABLE_ARTICLE, {
// 	// 	// 	id: item.id
// 	// 	// })
// 	// })
// }